import request from "@/utils/request";

export function authApi(tl,as,dj,url = '',data){
	return request({
	  url: 'kangarooDataCenter/entranceController/option' + url,
	headers: {
	  tl:tl,
	  as:as,
	  dj:dj,
	},
	  method: 'post',
	  data: data
	})
}

//登录
export function loginToken(data) {
  return request({
    url: "/Api/Token/CreateToken",
    method: "post",
    data,
  });
}

//token认证
export function CheckToken(data) {
  return request({
    url: "Api/Base/CheckToken",
    method: "post",
    data,
  });
}
//组织机构列表
export function GetOrganTree(data) {
  return request({
    url: "OrganManage/GetOrganTree",
    method: "post",
    data,
  });
}
//上传文件管理器
export function UploadFiles(data, onUploadProgress) {
  return request({
    url: "/Api/Attachments/UploadToMinio",
    method: "post",
    data,
    onUploadProgress,
  });
}
//上传服务器本地
export function UploadFilesLocal(data, onUploadProgress) {
  return request({
    url: "/api/Attachments/UploadFiles",
    method: "post",
    data,
    onUploadProgress,
  });
}
// 上传列表
export function UploadList(data, onUploadProgress) {
  return request({
    url: "/api/Attachments/GetFileList",
    method: "post",
    data,
    onUploadProgress,
  });
}
export function DownloadFiles(data) {
  return request({
    url: "/Api/Attachments/DownloadFiles",
    method: "post",
    data,
    responseType: "blob",
  });
}
// 查看
export function downloadFromMinio(data) {
  return request({
    url: "/api/Attachments/DownloadFromMinio",
    method: "post",
    data,
    responseType: "blob",
  });
}
//获取token
export function getToken(data) {
  return request({
    url: "/Api/Token/CreateToken",
    method: "post",
    data,
  });
}

export function commonFun(url, data) {
  return request({
    url: url,
    method: "post",
    data,
  });
}
